import React, { useState, useEffect } from 'react'
import { Calendar } from 'antd'
import { IDraggable } from '../../../../dnd/component_type'

export default function CalendarPreview (props: IDraggable) {
  const { config, data, meta } = props
  const [current, setCurrent] = useState('mail');

  const handleClick = (e: any) => {
    console.log('click ', e);
    setCurrent(e.key)
  };

  return (
    <Calendar onClick={ handleClick } selectedKeys={[current]} { ...config.attr } />
  );
}